import logging
from logging.handlers import SysLogHandler, RotatingFileHandler
from appCustomers.config import log_level

logger = logging.getLogger()
logger.setLevel(log_level)

stdout_handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
stdout_handler.setFormatter(formatter)

syslog_handler = SysLogHandler(address='/dev/log')

rfile_handler = RotatingFileHandler('appCustomer.log', maxBytes=10000, backupCount=3)

logger.addHandler(stdout_handler)
#logger.addHandler(syslog_handler)
logger.addHandler(rfile_handler)
